﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using YasharEl.Infrastructure.ApplicationModel.Bootstrap.Extensibility;
using System.Linq.Expressions;
using YasharEl.Infrastructure.ApplicationModel.Bootstrap.Behavior;

namespace YasharEl.Infrastructure.ApplicationModel.Bootstrap.Syntax
{
    /// <summary>
    /// Fluent definition syntax interface for behaviors which operate on contexts.
    /// </summary>
    /// <typeparam name="TExtension">The type of the extension.</typeparam>
    /// <typeparam name="TContext">The type of the context.</typeparam>
    public interface IWithBehaviorOnContext<TExtension, TContext> : IExecuteAction<TExtension>,
                                                                    IExecuteActionOnExtension<TExtension>,
                                                                    IExecuteActionOnExtensionWithContext<TExtension>,
                                                                    IEndSyntax<TExtension>
        where TExtension : IBootstrappingExtension
    {
        /// <summary>
        /// Attaches a behavior which has access to the context to the currently built executable.
        /// </summary>
        /// <param name="provider">The behavior provider.</param>
        /// <returns>The syntax.</returns>
        IWithBehaviorOnContext<TExtension, TContext> With(Expression<Func<TContext, IBehavior<TExtension>>> provider);
    }
}
